import os
import pandas
import requests

instr = requests.get('https://api.sandbox.prex.sh/api/v1/instrument/list?isTradable=true')
df = pandas.DataFrame(instr.json()['instruments'])

requests.get('http://fapi.binance.com/fapi/v1/openInterest').json()

seris = []
for _, row in df.iterrows():
  base = row['symbol'].split("USD.PERP")[0]
  oi_addr = f'http://fapi.binance.com/fapi/v1/openInterest?symbol={base}USDT'
  seris.append(pandas.Series(requests.get(oi_addr).json()))

pandas.options.display.float_format = '{:,.2f}'.format
df = pandas.DataFrame(seris)[['symbol', 'openInterest']]
df['openInterest'] = df['openInterest'].astype(float) * 1e-2
print(df.to_string())
